package org.fireflow.permission.reference;

import junit.framework.TestCase;

public class CollectionSetTest extends TestCase {

	protected void setUp() throws Exception {
		super.setUp();
	}

	protected void tearDown() throws Exception {
		super.tearDown();
	}

	public void testIntersectionSet() {
		CollectionSet cs1 = new CollectionSet("1");
		CollectionSet cs2 = new CollectionSet("2");
		int result = cs1.intersectionSet(cs2).getRefSet().size();
		assertEquals(0 , result); 
	}

	public void testUnionSet() {
		CollectionSet cs1 = new CollectionSet("1");
		CollectionSet cs2 = new CollectionSet("2");
		int result = cs1.unionSet(cs2).getRefSet().size();
		assertEquals(2,result);
	}

	public void testDifferenceSet() {
		CollectionSet cs1 = new CollectionSet("1");
		CollectionSet cs2 = new CollectionSet("2");
		int result = cs1.unionSet(cs2).getRefSet().size();
		assertEquals(2,result);
	}

	public void testSubset() {
		CollectionSet cs1 = new CollectionSet("1");
		CollectionSet cs2 = new CollectionSet("2");
		int result = cs1.unionSet(cs2).getRefSet().size();
		assertEquals(2,result);
	}

	public void testProperSubset() {
		CollectionSet cs1 = new CollectionSet("1");
		CollectionSet cs2 = new CollectionSet("2");
		int result = cs1.unionSet(cs2).getRefSet().size();
		assertEquals(2,result);
	}

	public void testSameSet() {
		CollectionSet cs1 = new CollectionSet("1");
		CollectionSet cs2 = new CollectionSet("2");
		int result = cs1.unionSet(cs2).getRefSet().size();
		assertEquals(2,result);
	}

}
